<ion-view view-title="{{title}}" class="adddiscount">
	<ion-nav-bar ng-class="baseclass">
		<ion-nav-back-button></ion-nav-back-button>
		<ion-nav-buttons side="right">
			<!--<p class="savebtntext f-size-15" on-tap="submit()" ng-if="input.type!=0">{{btnname}}保存</p>-->
			<button class="button button-clear saveText" on-tap="submit()" ng-if="input.type!=0">{{btnname}}保存</button>
		</ion-nav-buttons>
	</ion-nav-bar>
	
	<!--详情-->
	<ion-content class="bg">
		<div class="list" ng-if="input.type==0">
			<div class="item item-input padding-0 is_openframe item-toggle margin-bottom-10">
				<span>开启状态</span>
				<span class="is_openframetext" ng-if="input.status2">已开启</span>
				<span class="is_openframetext" ng-if="!input.status2">未开启</span>
			</div>
			<div class="item item-input padding-0 frame margin-bottom-10">
				<span class="activitytext1 activityname">名称</span>
				<span class="padding-left-30 activitytext1">{{input.name}}</span>
			</div>
			<div class="item item-input padding-0 margin-bottom-1 frame">
				<span class="activitytext1 activityname">面额</span>
				<span class="activitytext1 padding-left-30">{{input.amount}}元</span>
			</div>
			<div class="item item-input padding-0 frame margin-bottom-10">
				<span class="activitytext1">使用条件</span>
				<span ng-if="input.cond1" class="activitytext1 padding-left-30">满{{input.condition_amount1}}元减{{input.amount}}元</span>
				<span ng-if="input.cond2" class="activitytext1 padding-left-30">满{{input.condition_amount2}}元使用</span>
			</div>
			<li class="item item-input padding-0 frame margin-bottom-1">
				<span class="activitytext1">开始时间</span>
				<span class="padding-left-30 activitytext1">{{input.start_time| date:'yyyy-MM-dd'}}</span>
			</li>
			<li class="item item-input padding-0 frame margin-bottom-10">
				<span class="activitytext1">结束时间</span>
				<span class="padding-left-30 activitytext1">{{input.end_time| date:'yyyy-MM-dd'}}</span>
			</li>
			<div class="item padding-0 margin-bottom-10 partakeframe">
				<div class="shoppartake">
					<span class="activitytext1 activityname">参与商品</span>
				</div>
				<div class="shopinfoframe">
					<span class="padding-left-30 activitytext1" ng-if="input.goods.length==0||input.goods==null">全部商品</span>
					<p class="activitytext1 right-zhang" ng-class="input.goods.length-1==$index?'':'border_bottom'" ng-repeat="g in input.goods">{{g.name}}</p>
				</div>
			</div>
			<div class="item item-input padding-0 margin-bottom-10 frame">
				<span class="activitytext1">参与会员</span>
				<span class="activitytext1 padding-left-30" ng-if="level[0]&&level[1]&&level[2]">全平台会员</span>
				<div class="memberframe" ng-if="!level[0]||!level[1]||!level[2]">
					<div class="grade item-input padding-0" ng-if="level[0]">
						普通
					</div>
					<div class="grade item-input padding-0" ng-if="level[1]">
						初级
					</div>
					<div class="grade item-input padding-0" ng-if="level[2]">
						高级
					</div>
				</div>
			</div>
		</div>

		<!--编辑-->
		<div class="list" ng-if="input.type!=0">
			<div class="item item-input padding-0 is_openframe item-toggle margin-bottom-10">
				<span>是否开启</span>
				<label class="toggle toggle-balanced top_right">
		            <input type="checkbox" ng-model="input.status2">
			            <div class="track">
			            	<div class="handle"></div>
		            	</div>
	           </label>
			</div>
			<div class="item item-input padding-0 frame margin-bottom-10">
				<span class="activitytext1 activityname">名称</span>
				<input class="padding-left-30" ng-class="input.name?'activitytext1':'activitytext2'" type="text" ng-model="input.name" placeholder="请输入优惠券名称">
				<img src="./img/guilin/common/icon_delete_g@2x.png" class="img" ng-if="input.name" on-tap="clearinput(1)" />
			</div>
			<div class="item item-input padding-0 margin-bottom-1 frame">
				<span class="activitytext1 activityname">面额</span>
				<div class="activitytext2 selecttime text-right" on-tap="openModal_tag()" ng-if="input.amount==null||input.amount==0">
					请选择<img src="./img/guilin/common/icon_right@2x.png" />
				</div>
				<div class="activitytext2 item-input padding-0 selecttime" on-tap="openModal_tag(input.solutions_checked)" ng-if="input.amount!=0">
					<span class="padding-left-30 activitytext1" style="font-size: 17px;">{{input.amount}}</span>
					<img class="right" src="./img/guilin/common/icon_right@2x.png" />
				</div>
			</div>
			<div class="item item-input padding-0 frame margin-bottom-1">
				<span class="activitytext1">使用条件</span>
				<img src="./img/guilin/promo/radio@2x.png" class="selectimg" ng-if="!input.cond1" on-tap="u_cond1()" />
				<img src="./img/guilin/promo/radio-Selected@2x.png" class="selectimg" ng-if="input.cond1" on-tap="u_cond1()" />
				<span>满</span>
				<div class="item-input padding-0 text-right">
					<input class="text-right padding-0" ng-class="input.condition_amount1!='0'?'activitytext1':'activitytext2'" ng-model="input.condition_amount1" type="text">
					<span class="padding-top-bottom-10 ">元使用</span>
				</div>
			</div>
			<div class="item item-input padding-0 frame margin-bottom-10">
				<img src="./img/guilin/promo/radio@2x.png" class="selectimg margin-left-94" ng-if="!input.cond2" on-tap="u_cond2()" />
				<img src="./img/guilin/promo/radio-Selected@2x.png" class="selectimg margin-left-94" ng-if="input.cond2" on-tap="u_cond2()" /> 满{{input.amount2}}元使用
				<img class="noteimg" src="./img/guilin/common/icon_note@2x.png" on-tap="show_maxi()" />
			</div>
			<li class="item item-input padding-0 frame margin-bottom-1" ion-datetime-picker title="'请输入开始时间'" is-hide-hour="true" ng-model="input.start_time">
				<span class="activitytext1">开始时间</span>
				<div class="activitytext2 text-right selecttime" ng-if="input.start_time==null">
					请选择
				</div>
				<div class="activitytext1 item-input padding-0 selecttime" ng-if="input.start_time!=null" style="padding-left: 30px;">
					<input type="text" placeholder="" readonly="" ng-class="{'timeNoneInfo':input.start_time}">{{input.start_time| date: "yyyy-MM-dd"}}</input>
				</div>
				<img class="margin-left-10-my margin-right-10-my img" src="./img/guilin/common/icon_right@2x.png" />
			</li>
			<li class="item item-input padding-0 frame margin-bottom-10" ion-datetime-picker title="'请输入结束时间'" is-hide-hour="true" ng-model="input.end_time">
				<span class="activitytext1">结束时间</span>
				<div class="activitytext2 text-right selecttime" ng-if="input.end_time==null">
					请选择
				</div>
				<div class="activitytext1 item-input padding-0 selecttime" ng-if="input.end_time!=null" style="padding-left: 30px;">
					<input type="text" placeholder="" readonly="" ng-class="{'timeNoneInfo':input.end_time}">{{input.end_time| date: "yyyy-MM-dd"}}</input>
				</div>
				<img class="margin-left-10-my margin-right-10-my img" src="./img/guilin/common/icon_right@2x.png" />
			</li>
			<div class="item item-input padding-0 margin-bottom-1 frame">
				<span class="activitytext1">发行量</span>
				<img class="noteimg" src="./img/guilin/common/icon_note@2x.png" on-tap="show_i()" />
				<div class="item-input padding-0 text-right">
					<input class="text-right padding-0" ng-class="input.issue_count!='0'?'activitytext1':'activitytext2'" ng-model="input.issue_count" type="text" placeholder="0">
					<span class="padding-top-bottom-10 ">张</span>
				</div>
			</div>
			<div class="item item-input padding-0 margin-bottom-10 frame">
				<span class="activitytext1">每人限领</span>
				<div class="item-input padding-0 text-right">
					<input class="text-right padding-0" ng-class="input.limit_count!='0'?'activitytext1':'activitytext2'" ng-model="input.limit_count" type="text" placeholder="0">
					<span class="padding-top-bottom-10 ">张</span>
				</div>
			</div>
			<div class="item item-input padding-0 frame" ng-class="input.goods.length!=0?'margin-bottom-1':'margin-bottom-10'">
				<span class="activitytext1 activityname">商品范围</span>
				<div class="activitytext1 selecttime text-right" on-tap="openModal_goodsList()" ng-if="input.goods.length!=0">
					添加<img src="./img/guilin/common/icon_right@2x.png" />
				</div>
				<div class="activitytext2 item-input padding-0 selecttime" on-tap="openModal_goodsList()" ng-if="input.goods.length==0">
					<span class="padding-left-30 activitytext1">全部商品(默认)</span>
					<img class="right" src="./img/guilin/common/icon_right@2x.png" />
				</div>
			</div>
			<div class="item margin-bottom-10 shopframe" ng-if="input.goods.length!=0">
				<div class="item-input padding-0 shoptext activitytext1" ng-repeat="g in input.goods">
					<p class="activitytext1 shoptext text-right">{{g.name}}</p>
					<img src="./img/guilin/common/icon_delete_g@2x.png" on-tap="delgoods($index)" />
				</div>
			</div>
			<div class="item item-input padding-0 margin-bottom-10 frame">
				<span class="activitytext1">会员等级</span>
				<div class="memberframe">
					<div class="grade item-input padding-0" on-tap="updatalevel(0)">
						<img src="./img/guilin/common/icon_checked_b@2x.png" ng-if="level[0]" />
						<img src="./img/guilin/common/icon_uncheck_b@2x.png" ng-if="!level[0]" /> 普通
					</div>
					<div class="grade item-input padding-0" on-tap="updatalevel(1)">
						<img src="./img/guilin/common/icon_checked_b@2x.png" ng-if="level[1]" />
						<img src="./img/guilin/common/icon_uncheck_b@2x.png" ng-if="!level[1]" /> 初级
					</div>
					<div class="grade item-input padding-0" on-tap="updatalevel(2)">
						<img src="./img/guilin/common/icon_checked_b@2x.png" ng-if="level[2]" />
						<img src="./img/guilin/common/icon_uncheck_b@2x.png" ng-if="!level[2]" /> 高级
					</div>
				</div>
			</div>
	</ion-content>
</ion-view>